<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="dominio.SolicitudCompra"%>
<%@page language="java" import="java.util.*"%>
<h1>Lista de Solicitudes de Compra</h1>
<form id="solicitudesCompra" method="post" class="form-inline" role="form">
	<div class="table-responsive">
		<table class="table table-bordered table-striped">
			<thead>
				<tr>
					<th></th>
					<th>Codigo de Solicitud de Compra</th>
					<th>Estado</th>
				</tr>
			</thead>
			<tbody>
				<%
					List<SolicitudCompra> data = (List<SolicitudCompra>) request.getAttribute("data");
					for (Iterator<SolicitudCompra> itr = data.iterator(); itr.hasNext();) {
						SolicitudCompra solicitudCompra = itr.next();
				%>
				<tr>
					<% if (!solicitudCompra.estaEntregada()) {%>
					<td><input name="seleccionado" type="checkbox"
						value="<%=solicitudCompra.getCodigo()%>"></td>
					<%} else {%>
					<td></td>
					<%}%>
					<td><span><%=solicitudCompra.getIdSolicitud()%></span></td>
					<td><span><%=solicitudCompra.getEstado().toString()%></span></td>
				</tr>
				<%}%>
			</tbody>
		</table>
	</div>
	<% if (data.size() > 0) {%>
	<div class="form-group">
		<div class="col-sm-2 control-label">
			<div class="col-sm-10">
				<button type="submit" class="btn btn-success">Fabricar</button>
			</div>
		</div>
	</div>
	<%} %>
</form>
<script type="text/javascript" src="js/tpiaFabrica.js"></script>